package org.ws.kardex.model;

/**
 *
 * @author gerardino
 */

import com.google.appengine.api.datastore.Key;
import javax.jdo.annotations.*;

@PersistenceCapable
public class Operation {

    public static final int INPUT = 0;
    public static final int OUTPUT = 1; 
    
    @PrimaryKey
    @Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY)
    private Key id;
    
    @Persistent
    private int operation;
    
    @Persistent
    private double amount;
    
    @Persistent
    private Product p;
    
    public Operation(int operation, double amount, Product p){
        this.operation = operation;
        this.amount = amount;
        this.p = p;
    }
    
    public Key getId(){
        return this.id;
    }
    public int getOperation(){
        return this.operation;
    }
    public void setOperation(int operation){
        this.operation = operation;
    }
    public double getAmount(){
        return this.amount;
    }
    public void setAmount(double amount){
        this.amount = amount;
    }
    public Product getProduct(){
        return this.p;
    }
    public void setName(Product p){
        this.p = p;
    }
}
